/*
 * request_handler.cpp
 *
 *  Created on: 2021年2月7日
 *      Author: kimfeng
 */

#include "callback_handler.h"

callback_handler::callback_handler()
{
}

void callback_handler::attech_callback_func(const ushort req_num, CallbackFunction f)
{
	MapRequestFunctionItr itr = m_functions.find(req_num);
	if (itr == m_functions.end())
	{
		m_functions[req_num] = f;
	}
}

CallbackFunction callback_handler::get_callback_func(const ushort req_num)
{
	MapRequestFunctionItr itr = m_functions.find(req_num);
	if (itr != m_functions.end())
	{
		return itr->second;
	}
	return NULL;
}
